package com.saclub.app.activity;

import android.app.Activity;
import android.content.Intent;
import android.view.View;
import butterknife.OnClick;

import com.offroader.core.DoubleClickExitHelper;
import com.offroader.core.OffRoaderActivity;
import com.saclub.app.R;
import com.saclub.app.common.MainTabEnum;
import com.saclub.app.fragment.MainFragment;

public class HomeActivity extends OffRoaderActivity {

	private DoubleClickExitHelper mDoubleClickExit;

	@Override
	public int getContentView() {
		return R.layout.frag_home;
	}

	@Override
	public void initView() {
		mDoubleClickExit = new DoubleClickExitHelper(this);
	}

	@Override
	public void initData() {

	}

	@Override
	public void onBackPressed() {
		// 是否退出应用
		mDoubleClickExit.onBackPressed();
	}

	@OnClick({ R.id.id_home_saclub_btn, R.id.id_home_mars_btn, R.id.id_home_venus_btn })
	public void goToSaClub(View view) {

		switch (view.getId()) {
		case R.id.id_home_saclub_btn:
			MainFragment.go(this, MainTabEnum.saclub);
			break;

		case R.id.id_home_mars_btn:
			MainFragment.go(this, MainTabEnum.mars);
			break;

		case R.id.id_home_venus_btn:
			MainFragment.go(this, MainTabEnum.venus);
			break;

		default:
			break;
		}

	}

	public static void go(Activity act) {
		Intent intent = new Intent(act, HomeActivity.class);
		act.startActivity(intent);
	}

}
